package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the DETECTION_ database table.
 * 
 */
@Entity
@Table(name="DETECTION_")
@NamedQuery(name="Detection.findAll", query="SELECT d FROM Detection d")
public class Detection implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="DETECTION__DETECTIONID_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DETECTION__DETECTIONID_GENERATOR")
	@Column(name="DETECTION_ID")
	private long detectionId;

	@Column(name="DETECTION_DAYS")
	private BigDecimal detectionDays;

	@Column(name="DETECTION_EXPLAIN")
	private String detectionExplain;

	@Temporal(TemporalType.DATE)
	@Column(name="DETECTION_FINISHDATE")
	private Date detectionFinishdate;

	@Temporal(TemporalType.DATE)
	@Column(name="DETECTION_FINISHTIME")
	private Date detectionFinishtime;

	@Column(name="DETECTION_IFDELETE")
	private BigDecimal detectionIfdelete;

	@Temporal(TemporalType.DATE)
	@Column(name="DETECTION_INTODATE")
	private Date detectionIntodate;

	@Column(name="DETECTION_STAFF")
	private String detectionStaff;

	@Temporal(TemporalType.DATE)
	@Column(name="DETECTION_STARTDATE")
	private Date detectionStartdate;

	@Temporal(TemporalType.DATE)
	@Column(name="DETECTION_STARTTIME")
	private Date detectionStarttime;

	//bi-directional many-to-one association to Repairorder
	@OneToOne
	@JoinColumn(name="REPAIRORDER_ID")
	@JSONField(serialize=false)
	private Repairorder repairorder;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="USER_ID")
	private User user;

	//用户id
	@Transient
	private Long userId;
	//维修工单id
	@Transient
	private Long repairorderId;

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getRepairorderId() {
		return repairorderId;
	}

	public void setRepairorderId(Long repairorderId) {
		this.repairorderId = repairorderId;
	}

	public Detection() {
	}

	public long getDetectionId() {
		return this.detectionId;
	}

	public void setDetectionId(long detectionId) {
		this.detectionId = detectionId;
	}

	public BigDecimal getDetectionDays() {
		return this.detectionDays;
	}

	public void setDetectionDays(BigDecimal detectionDays) {
		this.detectionDays = detectionDays;
	}

	public String getDetectionExplain() {
		return this.detectionExplain;
	}

	public void setDetectionExplain(String detectionExplain) {
		this.detectionExplain = detectionExplain;
	}

	public Date getDetectionFinishdate() {
		return this.detectionFinishdate;
	}

	public void setDetectionFinishdate(Date detectionFinishdate) {
		this.detectionFinishdate = detectionFinishdate;
	}

	public Date getDetectionFinishtime() {
		return this.detectionFinishtime;
	}

	public void setDetectionFinishtime(Date detectionFinishtime) {
		this.detectionFinishtime = detectionFinishtime;
	}

	public BigDecimal getDetectionIfdelete() {
		return this.detectionIfdelete;
	}

	public void setDetectionIfdelete(BigDecimal detectionIfdelete) {
		this.detectionIfdelete = detectionIfdelete;
	}

	public Date getDetectionIntodate() {
		return this.detectionIntodate;
	}

	public void setDetectionIntodate(Date detectionIntodate) {
		this.detectionIntodate = detectionIntodate;
	}

	public String getDetectionStaff() {
		return this.detectionStaff;
	}

	public void setDetectionStaff(String detectionStaff) {
		this.detectionStaff = detectionStaff;
	}

	public Date getDetectionStartdate() {
		return this.detectionStartdate;
	}

	public void setDetectionStartdate(Date detectionStartdate) {
		this.detectionStartdate = detectionStartdate;
	}

	public Date getDetectionStarttime() {
		return this.detectionStarttime;
	}

	public void setDetectionStarttime(Date detectionStarttime) {
		this.detectionStarttime = detectionStarttime;
	}

	public Repairorder getRepairorder() {
		return this.repairorder;
	}

	public void setRepairorder(Repairorder repairorder) {
		this.repairorder = repairorder;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}